package ristorante;

import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.sql.SQLException;

import javax.swing.SpringLayout;

public class RistoranteView {

	private JFrame frmRistorante;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					RistoranteView window = new RistoranteView();
					window.frmRistorante.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the application.
	 * @throws SQLException 
	 * @throws ClassNotFoundException 
	 */
	public RistoranteView() throws ClassNotFoundException, SQLException {
		initialize();
	}

	/**
	 * Initialize the contents of the frame.
	 * @throws SQLException 
	 * @throws ClassNotFoundException 
	 */
	private void initialize() throws ClassNotFoundException, SQLException {
		final PrenotazioniView PreView = new PrenotazioniView();
		frmRistorante = new JFrame();
		frmRistorante.setVisible(true);
		frmRistorante.setTitle("Ristorante");
		frmRistorante.setBounds(100, 100, 294, 276);
		frmRistorante.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		SpringLayout springLayout = new SpringLayout();
		frmRistorante.getContentPane().setLayout(springLayout);
		
		JButton btnPrenotazioni = new JButton("Prenotazioni");
		btnPrenotazioni.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				PreView.setVisible(true);
			}
		});
		springLayout.putConstraint(SpringLayout.NORTH, btnPrenotazioni, 62, SpringLayout.NORTH, frmRistorante.getContentPane());
		springLayout.putConstraint(SpringLayout.WEST, btnPrenotazioni, 83, SpringLayout.WEST, frmRistorante.getContentPane());
		frmRistorante.getContentPane().add(btnPrenotazioni);
		
		JButton btnTavoli = new JButton("Tavoli");
		springLayout.putConstraint(SpringLayout.NORTH, btnTavoli, 31, SpringLayout.SOUTH, btnPrenotazioni);
		springLayout.putConstraint(SpringLayout.WEST, btnTavoli, -105, SpringLayout.EAST, btnPrenotazioni);
		springLayout.putConstraint(SpringLayout.EAST, btnTavoli, 0, SpringLayout.EAST, btnPrenotazioni);
		frmRistorante.getContentPane().add(btnTavoli);
	}
}
